<?php

/**
 * Aluno form base class.
 *
 * @package    form
 * @subpackage aluno
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseAlunoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_aluno'                        => new sfWidgetFormInputHidden(),
      'nm_aluno'                        => new sfWidgetFormTextarea(),
      'tp_sexo'                         => new sfWidgetFormInput(),
      'dt_nascimento'                   => new sfWidgetFormDateTime(),
      'nm_pai'                          => new sfWidgetFormInput(),
      'nm_mae'                          => new sfWidgetFormInput(),
      'nm_profissao_pai'                => new sfWidgetFormInput(),
      'nm_empresa_pai'                  => new sfWidgetFormInput(),
      'nm_profissao_mae'                => new sfWidgetFormInput(),
      'nm_empresa_mae'                  => new sfWidgetFormInput(),
      'nu_telefone_pai'                 => new sfWidgetFormInput(),
      'nu_telefone_comercial_pai'       => new sfWidgetFormInput(),
      'nu_telefone_celular_pai'         => new sfWidgetFormInput(),
      'dt_nascimento_pai'               => new sfWidgetFormDateTime(),
      'nu_telefone_mae'                 => new sfWidgetFormInput(),
      'nu_telefone_comercial_mae'       => new sfWidgetFormInput(),
      'nu_telefone_celular_mae'         => new sfWidgetFormInput(),
      'dt_nascimento_mae'               => new sfWidgetFormDateTime(),
      'st_pai'                          => new sfWidgetFormInput(),
      'st_mae'                          => new sfWidgetFormInput(),
      'st_pais_juntos'                  => new sfWidgetFormInput(),
      'ds_naturalidade'                 => new sfWidgetFormInput(),
      'nu_fone_1'                       => new sfWidgetFormInput(),
      'nu_fone_2'                       => new sfWidgetFormInput(),
      'nu_fone_3'                       => new sfWidgetFormInput(),
      'id_dados_responsavel'            => new sfWidgetFormDoctrineChoice(array('model' => 'DadosResponsavel', 'add_empty' => true)),
      'st_transporte_escolar'           => new sfWidgetFormInput(),
      'nm_transporte_escolar'           => new sfWidgetFormInput(),
      'nm_motorista_transporte_escolar' => new sfWidgetFormInput(),
      'nu_telefone_transporte_escolar'  => new sfWidgetFormInput(),
      'st_aluno'                        => new sfWidgetFormInput(),
      'user_id'                         => new sfWidgetFormDoctrineChoice(array('model' => 'sfGuardUserProfile', 'add_empty' => true)),
      'id_endereco'                     => new sfWidgetFormDoctrineChoice(array('model' => 'Endereco', 'add_empty' => true)),
      'slug'                            => new sfWidgetFormInput(),
      'created_at'                      => new sfWidgetFormDateTime(),
      'updated_at'                      => new sfWidgetFormDateTime(),
      'deleted'                         => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_aluno'                        => new sfValidatorDoctrineChoice(array('model' => 'Aluno', 'column' => 'id_aluno', 'required' => false)),
      'nm_aluno'                        => new sfValidatorString(),
      'tp_sexo'                         => new sfValidatorString(array('max_length' => 1)),
      'dt_nascimento'                   => new sfValidatorDateTime(array('required' => false)),
      'nm_pai'                          => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'nm_mae'                          => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'nm_profissao_pai'                => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nm_empresa_pai'                  => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nm_profissao_mae'                => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nm_empresa_mae'                  => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nu_telefone_pai'                 => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_telefone_comercial_pai'       => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_telefone_celular_pai'         => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'dt_nascimento_pai'               => new sfValidatorDateTime(array('required' => false)),
      'nu_telefone_mae'                 => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_telefone_comercial_mae'       => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_telefone_celular_mae'         => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'dt_nascimento_mae'               => new sfValidatorDateTime(array('required' => false)),
      'st_pai'                          => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'st_mae'                          => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'st_pais_juntos'                  => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'ds_naturalidade'                 => new sfValidatorString(array('max_length' => 80, 'required' => false)),
      'nu_fone_1'                       => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_fone_2'                       => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_fone_3'                       => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'id_dados_responsavel'            => new sfValidatorDoctrineChoice(array('model' => 'DadosResponsavel', 'required' => false)),
      'st_transporte_escolar'           => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'nm_transporte_escolar'           => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'nm_motorista_transporte_escolar' => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'nu_telefone_transporte_escolar'  => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'st_aluno'                        => new sfValidatorString(array('max_length' => 1)),
      'user_id'                         => new sfValidatorDoctrineChoice(array('model' => 'sfGuardUserProfile', 'required' => false)),
      'id_endereco'                     => new sfValidatorDoctrineChoice(array('model' => 'Endereco', 'required' => false)),
      'slug'                            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'created_at'                      => new sfValidatorDateTime(array('required' => false)),
      'updated_at'                      => new sfValidatorDateTime(array('required' => false)),
      'deleted'                         => new sfValidatorBoolean(),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'Aluno', 'column' => array('slug')))
    );

    $this->widgetSchema->setNameFormat('aluno[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Aluno';
  }

}
